package cn.wuhan2019mwg.mobile.activity.wuhan2019mwg.activitys;

import android.content.Intent;
import android.os.Handler;
import android.widget.ImageView;

import cn.wuhan2019mwg.mobile.activity.wuhan2019mwg.R;
import cn.wuhan2019mwg.mobile.activity.wuhan2019mwg.base.BaseActivity;
import cn.wuhan2019mwg.mobile.activity.wuhan2019mwg.utils.Constance;

/**
 * Created by dell on 2017/10/30.
 */

public class WelComeAvitivity extends BaseActivity {

    private ImageView iv_welcome_bg;

    @Override
    protected int setLayoutId() {
        return R.layout.activity_welcome;
    }

    @Override
    protected void initView() {
        iv_welcome_bg = (ImageView) findViewById(R.id.iv_welcome_bg);
    }

    @Override
    protected void initData() {
        handler.postDelayed(runnable, Constance.START_TIME);
    }

    private Runnable runnable = new Runnable() {
        @Override
        public void run() {
            Intent intent = new Intent();
            //intent.setClass(WelComeAvitivity.this, StartActivity.class);
            intent.setClass(WelComeAvitivity.this, WelcomeWebActivity.class);
            startActivity(intent);
            finish();
        }
    };

    private Handler handler = new Handler();

    @Override
    protected void onStop() {
        super.onStop();
        handler.removeCallbacks(runnable);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        handler.removeCallbacks(runnable);
    }
}
